In a TCP/IP communication network, a session between two applications on different hosts needs to be established for a communication therebetween, which is usually composed of source IP address and port as well as destination IP address and port. When a host is created for a specific session (a host is a kind of application programming interface through which the application can access TCP/IP protocol stack to implement inter-application communication), packets in the session can be received or sent through it.
For a TCP/IP network QoS monitor at an application level, it is a general idea to bind the socket of a sniffing application of the monitor to the same destination IP address and port as those of an application to be monitored.
SO_REUSEADDR is one of the generic socket options, which allows completely duplicate bindings: if a pair of IP address and port has already been bound to one socket, then the same pair can be bound to another socket if the transport protocol support this feature. Normally this feature is supported only for UDP (User Datagram Protocol) sockets.
This feature is used in multicasting to allow one or more applications to run multiple times on the same host simultaneously. When a UDP datagram which is destined for either a broadcast IP address or a multicast IP address arrives, every bound socket of the multiple applications is able to receive a copy of the datagram. However, a datagram which is destined for a unicast address can be delivered to only one socket. If there are multiple sockets that match a unicast datagram, the result of which socket will receive the datagram is implementation-dependent. That is to say, among the bound sockets in unicast sessions, only one indefinite socket can receive the unicast packets. This is called the unicast duplicate binding problem (UDBP).